package br.com.sig.security.presentation.action;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import br.com.sig.cadastro.pessoas.business.model.embeddable.MeioDeContato;
import br.com.sig.cadastro.pessoas.business.model.entity.PessoaFisica;
import br.com.sig.cadastro.recursoshumanos.business.model.entity.Funcionario;
import br.com.sig.presentation.action.BaseListAction;
import br.com.sig.security.business.model.bo.UserBO;
import br.com.sig.security.business.model.entity.User;

@Named
@ViewScoped
public class UserList extends BaseListAction<User> {

	private static final long serialVersionUID = -1634914936667632291L;
	
	@Inject
	private UserBO userBO;

	@PostConstruct
	public void init() {
		setService(userBO);
	}
	
	@Override
	protected User createInstance() {
		User user = new User();
		user.setFuncionario(new Funcionario());
		user.getFuncionario().setPessoaFisica(new PessoaFisica());
		user.getFuncionario().getPessoaFisica().setMeioDeContato(new MeioDeContato());
		return user;
	}
}